load("@build_bazel_rules_android//android:rules.bzl", "android_library")

licenses(["notice"])

package(default_visibility = ["//visibility:public"])

java_library(
    name = "hmac_key_manager",
    srcs = ["HmacKeyManager.java"],
    deps = [
        ":chunked_mac",
        ":hmac_key",
        ":hmac_parameters",
        ":predefined_mac_parameters",
        "//proto:hmac_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:key_manager",
        "//src/main/java/com/google/crypto/tink:key_template",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink:secret_key_access",
        "//src/main/java/com/google/crypto/tink/config/internal:tink_fips_util",
        "//src/main/java/com/google/crypto/tink/internal:key_manager_registry",
        "//src/main/java/com/google/crypto/tink/internal:legacy_key_manager_impl",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_creation_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_derivation_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_parameters_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry",
        "//src/main/java/com/google/crypto/tink/internal:primitive_constructor",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception",
        "//src/main/java/com/google/crypto/tink/internal:util",
        "//src/main/java/com/google/crypto/tink/mac/internal:chunked_hmac_impl",
        "//src/main/java/com/google/crypto/tink/mac/internal:hmac_proto_serialization",
        "//src/main/java/com/google/crypto/tink/subtle:prf_mac",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

android_library(
    name = "hmac_key_manager-android",
    srcs = ["HmacKeyManager.java"],
    deps = [
        ":chunked_mac-android",
        ":hmac_key-android",
        ":hmac_parameters-android",
        ":predefined_mac_parameters-android",
        "//proto:hmac_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:key_manager-android",
        "//src/main/java/com/google/crypto/tink:key_template-android",
        "//src/main/java/com/google/crypto/tink:mac-android",
        "//src/main/java/com/google/crypto/tink:parameters-android",
        "//src/main/java/com/google/crypto/tink:secret_key_access-android",
        "//src/main/java/com/google/crypto/tink/config/internal:tink_fips_util-android",
        "//src/main/java/com/google/crypto/tink/internal:key_manager_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:legacy_key_manager_impl-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_creation_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_derivation_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_parameters_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_constructor-android",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception-android",
        "//src/main/java/com/google/crypto/tink/internal:util-android",
        "//src/main/java/com/google/crypto/tink/mac/internal:chunked_hmac_impl-android",
        "//src/main/java/com/google/crypto/tink/mac/internal:hmac_proto_serialization-android",
        "//src/main/java/com/google/crypto/tink/subtle:prf_mac-android",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes-android",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

java_library(
    name = "mac_factory",
    srcs = ["MacFactory.java"],
    deps = [
        ":mac_wrapper",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
    ],
)

android_library(
    name = "mac_factory-android",
    srcs = ["MacFactory.java"],
    deps = [
        ":mac_wrapper-android",
        "//src/main/java/com/google/crypto/tink:mac-android",
        "//src/main/java/com/google/crypto/tink:registry_cluster-android",
    ],
)

java_library(
    name = "mac_key_templates",
    srcs = ["MacKeyTemplates.java"],
    deps = [
        ":hmac_key_manager",
        "//proto:aes_cmac_java_proto",
        "//proto:common_java_proto",
        "//proto:hmac_java_proto",
        "//proto:tink_java_proto",
    ],
)

android_library(
    name = "mac_key_templates-android",
    srcs = ["MacKeyTemplates.java"],
    deps = [
        ":hmac_key_manager-android",
        "//proto:aes_cmac_java_proto_lite",
        "//proto:common_java_proto_lite",
        "//proto:hmac_java_proto_lite",
        "//proto:tink_java_proto_lite",
    ],
)

java_library(
    name = "mac_wrapper",
    srcs = ["MacWrapper.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:crypto_format",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:primitive_wrapper",
        "//src/main/java/com/google/crypto/tink/internal:legacy_proto_key",
        "//src/main/java/com/google/crypto/tink/internal:monitoring_util",
        "//src/main/java/com/google/crypto/tink/internal:mutable_monitoring_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry",
        "//src/main/java/com/google/crypto/tink/internal:primitive_constructor",
        "//src/main/java/com/google/crypto/tink/internal:primitive_registry",
        "//src/main/java/com/google/crypto/tink/internal:primitive_set",
        "//src/main/java/com/google/crypto/tink/mac/internal:legacy_full_mac",
        "//src/main/java/com/google/crypto/tink/monitoring:monitoring_client",
        "//src/main/java/com/google/crypto/tink/monitoring:monitoring_keyset_info",
    ],
)

android_library(
    name = "mac_wrapper-android",
    srcs = ["MacWrapper.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:crypto_format-android",
        "//src/main/java/com/google/crypto/tink:mac-android",
        "//src/main/java/com/google/crypto/tink:primitive_wrapper-android",
        "//src/main/java/com/google/crypto/tink/internal:legacy_proto_key-android",
        "//src/main/java/com/google/crypto/tink/internal:monitoring_util-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_monitoring_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_constructor-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_set-android",
        "//src/main/java/com/google/crypto/tink/mac/internal:legacy_full_mac-android",
        "//src/main/java/com/google/crypto/tink/monitoring:monitoring_client-android",
        "//src/main/java/com/google/crypto/tink/monitoring:monitoring_keyset_info-android",
    ],
)

java_library(
    name = "mac_config",
    srcs = ["MacConfig.java"],
    deps = [
        ":aes_cmac_key_manager",
        ":chunked_mac_wrapper",
        ":hmac_key_manager",
        ":mac_wrapper",
        "//proto:config_java_proto",
        "//src/main/java/com/google/crypto/tink/config:tink_fips",
    ],
)

android_library(
    name = "mac_config-android",
    srcs = ["MacConfig.java"],
    deps = [
        ":aes_cmac_key_manager-android",
        ":chunked_mac_wrapper-android",
        ":hmac_key_manager-android",
        ":mac_wrapper-android",
        "//proto:config_java_proto_lite",
        "//src/main/java/com/google/crypto/tink/config:tink_fips-android",
    ],
)

java_library(
    name = "aes_cmac_key_manager",
    srcs = ["AesCmacKeyManager.java"],
    deps = [
        ":aes_cmac_key",
        ":aes_cmac_parameters",
        ":chunked_mac",
        ":predefined_mac_parameters",
        "//proto:aes_cmac_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:key_manager",
        "//src/main/java/com/google/crypto/tink:key_template",
        "//src/main/java/com/google/crypto/tink:mac",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink/config/internal:tink_fips_util",
        "//src/main/java/com/google/crypto/tink/internal:key_manager_registry",
        "//src/main/java/com/google/crypto/tink/internal:legacy_key_manager_impl",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_creation_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_parameters_registry",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry",
        "//src/main/java/com/google/crypto/tink/internal:primitive_constructor",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception",
        "//src/main/java/com/google/crypto/tink/mac/internal:aes_cmac_proto_serialization",
        "//src/main/java/com/google/crypto/tink/mac/internal:chunked_aes_cmac_impl",
        "//src/main/java/com/google/crypto/tink/subtle:prf_mac",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

android_library(
    name = "aes_cmac_key_manager-android",
    srcs = ["AesCmacKeyManager.java"],
    deps = [
        ":aes_cmac_key-android",
        ":aes_cmac_parameters-android",
        ":chunked_mac-android",
        ":predefined_mac_parameters-android",
        "//proto:aes_cmac_java_proto_lite",
        "//proto:tink_java_proto_lite",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:key_manager-android",
        "//src/main/java/com/google/crypto/tink:key_template-android",
        "//src/main/java/com/google/crypto/tink:mac-android",
        "//src/main/java/com/google/crypto/tink:parameters-android",
        "//src/main/java/com/google/crypto/tink/config/internal:tink_fips_util-android",
        "//src/main/java/com/google/crypto/tink/internal:key_manager_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:legacy_key_manager_impl-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_key_creation_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_parameters_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_constructor-android",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception-android",
        "//src/main/java/com/google/crypto/tink/mac/internal:aes_cmac_proto_serialization-android",
        "//src/main/java/com/google/crypto/tink/mac/internal:chunked_aes_cmac_impl-android",
        "//src/main/java/com/google/crypto/tink/subtle:prf_mac-android",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes-android",
        "@maven//:com_google_code_findbugs_jsr305",
    ],
)

java_library(
    name = "mac_key",
    srcs = ["MacKey.java"],
    deps = [
        ":mac_parameters",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink/util:bytes",
    ],
)

android_library(
    name = "mac_key-android",
    srcs = ["MacKey.java"],
    deps = [
        ":mac_parameters-android",
        "//src/main/java/com/google/crypto/tink:key-android",
        "//src/main/java/com/google/crypto/tink/util:bytes-android",
    ],
)

java_library(
    name = "mac_parameters",
    srcs = ["MacParameters.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:parameters",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "mac_parameters-android",
    srcs = ["MacParameters.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:parameters-android",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "aes_cmac_key",
    srcs = ["AesCmacKey.java"],
    deps = [
        ":aes_cmac_parameters",
        ":mac_key",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink/internal:output_prefix_util",
        "//src/main/java/com/google/crypto/tink/util:bytes",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "aes_cmac_key-android",
    srcs = ["AesCmacKey.java"],
    deps = [
        ":aes_cmac_parameters-android",
        ":mac_key-android",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:key-android",
        "//src/main/java/com/google/crypto/tink/internal:output_prefix_util-android",
        "//src/main/java/com/google/crypto/tink/util:bytes-android",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes-android",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "aes_cmac_parameters",
    srcs = ["AesCmacParameters.java"],
    deps = [
        ":mac_parameters",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "aes_cmac_parameters-android",
    srcs = ["AesCmacParameters.java"],
    deps = [
        ":mac_parameters-android",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "hmac_parameters",
    srcs = ["HmacParameters.java"],
    deps = [
        ":mac_parameters",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "hmac_parameters-android",
    srcs = ["HmacParameters.java"],
    deps = [
        ":mac_parameters-android",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "chunked_mac",
    srcs = ["ChunkedMac.java"],
    deps = [
        ":chunked_mac_computation",
        ":chunked_mac_verification",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "chunked_mac-android",
    srcs = ["ChunkedMac.java"],
    deps = [
        ":chunked_mac_computation-android",
        ":chunked_mac_verification-android",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "chunked_mac_computation",
    srcs = ["ChunkedMacComputation.java"],
)

android_library(
    name = "chunked_mac_computation-android",
    srcs = ["ChunkedMacComputation.java"],
)

java_library(
    name = "chunked_mac_verification",
    srcs = ["ChunkedMacVerification.java"],
)

android_library(
    name = "chunked_mac_verification-android",
    srcs = ["ChunkedMacVerification.java"],
)

java_library(
    name = "hmac_key",
    srcs = ["HmacKey.java"],
    deps = [
        ":hmac_parameters",
        ":mac_key",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink/internal:output_prefix_util",
        "//src/main/java/com/google/crypto/tink/util:bytes",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "hmac_key-android",
    srcs = ["HmacKey.java"],
    deps = [
        ":hmac_parameters-android",
        ":mac_key-android",
        "//src/main/java/com/google/crypto/tink:accesses_partial_key-android",
        "//src/main/java/com/google/crypto/tink:key-android",
        "//src/main/java/com/google/crypto/tink/internal:output_prefix_util-android",
        "//src/main/java/com/google/crypto/tink/util:bytes-android",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes-android",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

java_library(
    name = "chunked_mac_wrapper",
    srcs = ["ChunkedMacWrapper.java"],
    deps = [
        ":chunked_mac",
        ":chunked_mac_computation",
        ":chunked_mac_verification",
        "//src/main/java/com/google/crypto/tink:crypto_format",
        "//src/main/java/com/google/crypto/tink:primitive_wrapper",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry",
        "//src/main/java/com/google/crypto/tink/internal:primitive_registry",
        "//src/main/java/com/google/crypto/tink/internal:primitive_set",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "chunked_mac_wrapper-android",
    srcs = ["ChunkedMacWrapper.java"],
    deps = [
        ":chunked_mac-android",
        ":chunked_mac_computation-android",
        ":chunked_mac_verification-android",
        "//src/main/java/com/google/crypto/tink:crypto_format-android",
        "//src/main/java/com/google/crypto/tink:primitive_wrapper-android",
        "//src/main/java/com/google/crypto/tink/internal:mutable_primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_registry-android",
        "//src/main/java/com/google/crypto/tink/internal:primitive_set-android",
        "@maven//:com_google_errorprone_error_prone_annotations",
    ],
)

android_library(
    name = "predefined_mac_parameters-android",
    srcs = ["PredefinedMacParameters.java"],
    deps = [
        ":aes_cmac_parameters-android",
        ":hmac_parameters-android",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception-android",
    ],
)

java_library(
    name = "predefined_mac_parameters",
    srcs = ["PredefinedMacParameters.java"],
    deps = [
        ":aes_cmac_parameters",
        ":hmac_parameters",
        "//src/main/java/com/google/crypto/tink/internal:tink_bug_exception",
    ],
)
